﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SwenAssignment3.Classes;

namespace SwenAssignment3.ReportingModule
{
    public partial class HousekeepingReport : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GridViewStaff.DataSource = DRHotelDBManager.getAllDuties(dutiesNameDLL.SelectedValue).ToList();
                GridViewStaff.DataBind();
                dutiesNameDLL.DataSource = DRHotelDBManager.retrieveAllDutiesNames().ToList();
                dutiesNameDLL.DataBind();
            }
        }

       

      

        protected void dutiesNameDLL_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewStaff.DataSource = DRHotelDBManager.getAllDuties(dutiesNameDLL.SelectedValue).ToList();
            GridViewStaff.DataBind();
            
        }

      
    }
}